import Vue from 'vue';
import Router from 'vue-router';
import routes from './routes';

import Validate from '../app/Validate';
import OperateCenter from '../app/OperateCenter';
import ServiceCenter from '../app/ServiceCenter';

Vue.use(Router);

let allRoutes = [
  {
    path: '/',
    redirect: '/validate'
  },
  {
    path: '/validate',
    component: Validate,
    children: [
      {
        path: '/app-oc',
        name: 'OperateCenter',
        component: OperateCenter
      },
      {
        path: '/app-sc',
        component: ServiceCenter,
        children: routes
      }
    ]
  }
];

export default new Router(
  {
    routes: allRoutes
  }
);
